<!DOCTYPE html>
<html>
<head>
    <title><%= title %></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='stylesheet' href='/css/bootstrap.min.css' />
    <link rel="stylesheet" type="text/css" href="/css/style.css">
    <script src="/script/jquery.min.js"></script>
    <script src="/script/bootstrap.min.js"></script>
    <script src="/script/angular.min.js"></script>
</head>
<body> 
	<h1 class="title"><%= title %></h1>

	<form class="form-horizontal">
		<div class="form-group">
			<label for="Email" class="col-sm-3 control-label">Email</label>
			<div class="col-sm-6">
				<input type="email" class="form-control" id="Email" placeholder="Please input Email">	
			</div>
		</div>
		<div class="form-group">
			<label for="password" class="col-sm-3 control-label">Password</label>
			<div class="col-sm-6">
				<input type="password" class="form-control" id="password" placeholder="Please input pussword"> 
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9" style="text-align:right">
				<div class="checkbox">
					<label>
						<input type="checkbox">Remember me 30 days	
					</label>					
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9" style="text-align:right">
				<p>
					<button type="submit" class="btn btn-primary">sign up</button>
					<button type="submit" class="btn btn-primary">sign in</button>
				</p>
			</div>
		</div>
	</form>
	<button onclick="toforeground()">toforeground</button>
	<button onclick="getdriver1()">getdriver1</button>
	<button onclick="getdriver2()">getdriver2</button>
	<button onclick="postpassenger1()">postpassenger1</button>
	<button onclick="postpassenger2()">postpassenger2</button>
	<button onclick="passengercall()">passengercall</button>
	<button onclick="passengercancel()">passengercancel</button>
	<button onclick="getpassenger1()">getpassenger1</button>
	<button onclick="getpassenger2()">getpassenger2</button>
	<button onclick="postdriver1()">postdriver1</button>
	<button onclick="postdriver2()">postdriver2</button>
	<button onclick="driveranswer()">driveranswer</button>
	<button onclick="drivercancel()">drivercancel</button>
</body>
<script type="text/javascript">
 var toforeground = function(){
 	$.get('/api/toforeground',function(data){
 		console.log(data);
 	})
 };

 var getdriver1 = function(){
 	var json = {"username":"乘客1"};
 	$.post('/api/getdriver', json, function(data){
 		console.log(data);
 	})
 }

 var getdriver2 = function(){
 	var json = {"username":"乘客2"};
 	$.post('/api/getdriver', json, function(data){
 		console.log(data);
 	})
 }

 var postpassenger1 = function(){
 	var json = {"username":"乘客1","lat":"36","lon":"128"};
 	$.post('/api/postpassenger', json, function(data){
 		console.log(data);
 	})
 }
 var postpassenger2 = function(){
 	var json = {"username":"乘客2","lat":"37","lon":"129"};
 	$.post('/api/postpassenger', json, function(data){
 		console.log(data);
 	})
 }

  var passengercall = function(){
 	var json = {"username":"乘客1"};
 	$.post('/api/passengercall', json, function(data){
 		console.log(data);
 	})
 }
 var passengercancel = function(){
 	var json = {"username":"乘客1"};
 	$.post('/api/passengercancel', json, function(data){
 		console.log(data);
 	})
 }

  var getpassenger1 = function(){
 	var json = {"username":"司机1"};
 	$.post('/api/getpassenger', json, function(data){
 		console.log(data);
 	})
 }

   var getpassenger2 = function(){
 	var json = {"username":"司机2"};
 	$.post('/api/getpassenger', json, function(data){
 		console.log(data);
 	})
 }

  var postdriver1 = function(){
 	var json = {"username":"司机1" ,"lat":"21","lon":"229"};
 	$.post('/api/postdriver', json, function(data){
 		console.log(data);
 	})
 }

  var postdriver2 = function(){
 	var json = {"username":"司机2" ,"lat":"22","lon":"229"};
 	$.post('/api/postdriver', json, function(data){
 		console.log(data);
 	})
 }
  var driveranswer = function(){
 	var json = {"username":"司机1" ,"lat":"23","lon":"229"};
 	$.post('/api/driveranswer', json, function(data){
 		console.log(data);
 	})
 }
   var drivercancel = function(){
 	var json = {"username":"司机1"};
 	$.post('/api/drivercancel', json, function(data){
 		console.log(data);
 	})
 }
</script>
</html>